//-----------------------------------------------------------------------
//
//	Copyright 2002 e Professional Corporation.  All Rights Reserved.
//
//	File:	PropertiesManipulator.java
//
//	Author:	Manz
//
//	Date:	20/05/2002
//
//-----------------------------------------------------------------------

package com.epro.standard.frontend.system;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import java.util.Enumeration;
import java.util.Properties;

public class PropertyManipulator implements java.io.Serializable {

    private String propertyPath = "";
    private String propertyFileName = "defaultParameter.properties";
    private Properties property = new Properties();

    public PropertyManipulator() throws FileNotFoundException, IOException {
        loadProperty();
    }

    public PropertyManipulator(String pPath, 
                               String fName) throws FileNotFoundException, 
                                                    IOException {
        propertyPath = pPath;
        propertyFileName = fName;
        loadProperty();
    }

    public void loadProperty() throws FileNotFoundException, IOException {
        File propertyFile = new File(propertyPath + "/" + propertyFileName);
        property.load(new FileInputStream(propertyFile));
    }

    public Enumeration getPropertyName() {
        return property.propertyNames();
    }

    public String getProperty(String keyName) {
        return property.getProperty(keyName);
    }

    public String getPropertyPath() {
        return propertyPath;
    }

    public String getPropertyFileName() {
        return propertyFileName;
    }
}
